package cn.chen.数据结构.二叉树.二叉排序树;

public class BinarySortTreeTest {

    public static void main(String[] args){
        int[] a={7,3,10,12,5,1,9,2};

        BinarySortTree tree = new BinarySortTree();

        for(int aa:a)
            tree.addNode(new BinarySortTreeNode(aa));

        // 中序遍历
        tree.midOrder();

        System.out.println("删除节点");
        tree.deleteNode(2);
        tree.deleteNode(5);
        tree.deleteNode(9);
        tree.deleteNode(12);
        tree.deleteNode(7);
        tree.deleteNode(3);
        tree.deleteNode(10);
        tree.deleteNode(1);

        tree.midOrder();
    }
}
